package com.xjscrm.console.web.sysNotice;

import com.xjscrm.console.param.sysNotice.SysNoticeDto;
import com.xjscrm.console.param.sysNotice.SysNoticeQuery;
import com.xjscrm.console.service.common.sysNotice.SysNoticeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Api(value = "系统公告日志管理", tags = "系统公告日志管理")
@RestController
@RequestMapping(value = "/sysNotice")
public class SysNoticeController {

    @Autowired
    private SysNoticeService sysNoticeService;
    @ApiOperation(value = "新增系统公告日志", notes = "新增系统公告日志",response = boolean.class)
    @PostMapping(value ="/addSysNotice" )
     public Object addSysNotice(@RequestBody SysNoticeDto sysNoticeDto)throws Exception{
        sysNoticeService.addSysNotice(sysNoticeDto);
        return true;
     }


    @ApiOperation(value = "查询系统公告日志", notes = "查询系统公告日志",response = boolean.class)
    @PostMapping(value ="/getSysNotice" )
    public Object getSysNotice(@RequestBody SysNoticeQuery sysNoticeQuery)throws Exception{
        return  sysNoticeService.getSysNotice(sysNoticeQuery);
    }
}
